home *** CD-ROM | disk | FTP | other *** search
- From: Tony_Bateman@msn.com (Tony Bateman)
- Subject: Some help with a linker error...
- Date: 16 Jan 96 23:16:19 -0800
- Message-ID: <00001a81+00008ede@msn.com>
- Path: news.msn.com!msn.com
- Newsgroups: comp.lang.c++
- Organization: The Microsoft Network (msn.com)
-
- Can anybody help me on this problem...
-
- I have declared a class ACE2 in one module, with an offending
- declaration to the compiler which looks like this:
-
- //global variables
- extern int numberOfRules;
- extern fuzzyGaussFunc *pThisFuzzyFunc;
- extern fuzzyGaussFunc *pFuzzyGfunc;
- extern Vector stateVector;
-
- void ACE2::UpdatePt()
- {
- ptMinus1 = pt;
- pt = 0;
- for (int i=0; i<numberOfRules; i++) //numberOfRules gives an error {
- pThisFuzzyFunc = &pFuzzyGfunc[i]; //as does pThisFuzzyFunc and pFuzzyGfunc
- //+other stuff not relevent here...
- }
- }
-
- This **compiles** fine, but when the program is displaying the
- message "Linking, pass 2" it fails and displays 3 errors:
-
- "Linker Error: Undefined symbol _numberOfRules in module ACE2.CPP"
- "Linker Error: Undefined symbol _pThisFuzzyFunc in module ACE2.CPP"
- "Linker Error: Undefined symbol _pFuzzyGfunc in module ACE2.CPP"
-
-
- the global variables are part of another class ASE, which is defined
- in another module. The relevent parts of the class definition are
- here:
-
- class ace2;
- #include "fuzclass.h"
- class ASE
- {
- public:
- friend class ace2;
-
- protected:
-
- fuzzyVar noiseParameters[];
- fuzzyGaussFunc *pFuzzyGfunc;
- fuzzyGaussFunc *pThisFuzzyFunc;
- int numberOfRules;
- };
-
- Any idea why the "_" has been appended to the variables, and what is
- happening?
-
- All replies would be greatfully received.
-
- - A struggling C++ programmer who wishes he's stayed at home with
- Visual Basic!
-